package com.noocodecommit.wicket.jquery.plugin.poll;

import org.apache.wicket.IRequestTarget;
import org.apache.wicket.PageParameters;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.markup.html.WebPage;

public class ResultPollPage extends WebPage
{
	public ResultPollPage()
	{
		this(null);
	}
	
	public ResultPollPage(PageParameters params)
	{
		//add(new JQPollResult("poll"));

		getRequestCycle().setRequestTarget(new IRequestTarget()
		{
			public void detach(RequestCycle requestCycle)
			{
				// nothing to do here
			}

			public void respond(RequestCycle requestCycle)
			{
				// Add JSON script to the response
				requestCycle.getResponse().write("[[\"1\",\"jQuery\",\"20\"],[\"5\",\"YUI\",\"10\"],[\"4\",\"Prototype\",\"7\"],[\"3\",\"Dojo\",\"6\"],[\"2\",\"Ext JS\",\"5\"],[\"6\",\"mootools\",\"5\"]]");
			}
		});

	}
}